<!--
  Generated template for the DetailsPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

  <ion-navbar color="primary">
    <ion-title>{{data.code}}</ion-title>

    <ion-buttons right>

      <button ion-button icon-end solid style="font-size:10px;background-color:#3462ac" (click)="goList()">
        查看列表
      </button>

    </ion-buttons>

  </ion-navbar>

</ion-header>


<ion-content padding>

  <ion-segment [(ngModel)]="icons" (click)="go($event)">
    <ion-segment-button value="camera">
      实时数据
    </ion-segment-button>
    <ion-segment-button value="bookmark">
      历史数据
    </ion-segment-button>
  </ion-segment>


  <button ion-button block color="light" class="pp">
    <span *ngFor = "let item of dataRes">
        <span>&nbsp;{{item.name}}&nbsp;&nbsp;({{item.unit}})&nbsp;</span>
    </span>
</button>

  <ion-item class="start">
    <ion-label>开始时间</ion-label>
    <ion-datetime displayFormat="YYYY-MM-DD HH:mm:ss" [(ngModel)]="start" cancelText="取消" doneText="确认"></ion-datetime>
  </ion-item>
  <ion-item class="end">
    <ion-label>结束时间</ion-label>
    <ion-datetime displayFormat="YYYY-MM-DD HH:mm:ss" [(ngModel)]="end" cancelText="取消" doneText="确认"></ion-datetime>
  </ion-item>
  <div class="search">
    <div (click)="search()">搜索</div>
  </div>
  <div class="alert" *ngIf="text!==undefined">
    <div class="text">{{text}}</div>
    <div class="button">
      <button (click)="click()">知道了</button>
    </div>
  </div>

  <!-- <ion-row class="values" *ngIf="va">
    <ion-col col-3 class="colDiv">
      <div class="divC">
        <p class="title">平均值</p>
        <p style="color:#005fd4;font-size:16px;font-weight:500">{{avg}}</p>
      </div>
    </ion-col>
    <ion-col col-3 class="colDiv">
      <div class="divC">
        <p class="title">最高值</p>
        <p style="color:#ec8500;font-size:16px;font-weight:500">{{max}}</p>
      </div>
    </ion-col>
    <ion-col col-3 class="colDiv">
      <div class="divC">
        <p class="title">最低值</p>
        <p style="color:#45b005;font-size:16px;font-weight:500">{{min}}</p>
      </div>
    </ion-col>
    <ion-col col-3 class="colDiv">
      <div class="divC">
        <p class="title">幅值</p>
        <p style="color:#b800bf;font-size:16px;font-weight:500" *ngIf="max!==undefined">{{(max-min).toFixed(3)}}</p>
      </div>
    </ion-col>

  </ion-row> -->


  <div id="chart" style="margin-bottom:10px;"></div>


  <div id="chart1" style="margin-bottom:10px;"></div>


  <ion-segment [(ngModel)]="icons1" class="time">
    <ion-segment-button value="1">
      日
    </ion-segment-button>
    <ion-segment-button value="2">
      周
    </ion-segment-button>
    <ion-segment-button value="3">
      月
    </ion-segment-button>
    <ion-segment-button value="4">
      季
    </ion-segment-button>
    <!--     <ion-segment-button value="5">
      年
    </ion-segment-button> -->
  </ion-segment>


</ion-content>